package com.example.supernote.data.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.example.supernote.data.entity.TrashEntity
import kotlinx.coroutines.flow.Flow

@Dao
interface TrashEntityDao {
    @Insert
    suspend fun insert(file: TrashEntity)

    @Query("DELETE from tb_trash WHERE id = :id")
    suspend fun deleteById(id: Int)

    @Query("SELECT * from tb_trash WHERE id = :id")
    suspend fun getItem(id: Int): TrashEntity

    @Query("SELECT * from tb_trash")
    fun getAllItems(): Flow<List<TrashEntity>>

}